package example;

/**
 * 观察者
 * @Author itmei
 * @Package org.example
 * @Date 2025/8/4 11:05
 */
public class Subscriberimpl implements Subscriber{
    private String name;
    public Subscriberimpl(String name){
        this.name=name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(String message) {
        System.out.println("------------");
        System.out.println(name+"收到消息："+message);
    }
}
